package com.ccsc.auth.dao;

import com.ccsc.auth.entity.User;
import com.ccsc.auth.utils.DataMap;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by XingWen on 2016/3/29.
 */
public interface UserDao {
    User verifyAccount(User user) throws Exception;				    								//登录用户验证

    List<User> getAllUsers() throws Exception;       							                    //获取全部用户列表
    List<User> getAllUsers(DataMap dataMap,PageBounds pageBounds) throws Exception;       			//或者根据条件分页获取全部用户列表

    List<User> getUsersByCondition(User user) throws Exception;							            //根据条件查询用户列表
    List<User> getUsersByCondition(User user, PageBounds pageBounds)throws Exception;				//分页并根据条件查询用户列表

    User getUserInfoById(User user) throws Exception;                                                                   //通过用户id用户个人信息
    Integer getUserIdBySysId(DataMap dataMap) throws Exception;
    List<User> getUserInfoByRoleId(Integer roleID) throws Exception;                                                 //通过角色id查询用户个人信息
    List<User> getUserInfoByDepartmentOrPosition(@Param("departmentId") Integer departmentId,@Param("positionId") Integer positionId) throws Exception;            //通过部门id，职位id查询用户个人信息

    Integer createUser(User user) throws Exception;  												                    //添加用户
    Integer updateUser(User user) throws Exception;  												                    //修改用户
    Integer deleteUser(User user) throws Exception; 									    		                    //删除用户

    Integer createUserAndRole(User user) throws Exception;  												            //添加授权信息
    Integer deleteUserAndRole(DataMap params) throws Exception; 								                        //删除某一具体授权信息
    //修改授权信息为先删除该用户所有权限在重新添加权限

    Integer createUserAndPosition(@Param("userId") Integer userId,@Param("rdopId") Integer rdopId) throws Exception;  												//添加用户任职信息
    Integer deleteUserAndPosition(User user) throws Exception; 									    		            //删除用户任职信息
    Integer deleteUserAndPosition(@Param("userId") Integer userId,@Param("departmentId") Integer departmentId,@Param("positionId") Integer positionId) throws Exception; 									    		//删除用户任职信息

}